package com.xinchao.ck_mips.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.xinchao.ck_mips.bean.OffLineData;
import com.xinchao.ck_mips.bean.ProgramBean;

import com.xinchao.ck_mips.dao.OffLineDataDao;
import com.xinchao.ck_mips.dao.ProgramBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig offLineDataDaoConfig;
    private final DaoConfig programBeanDaoConfig;

    private final OffLineDataDao offLineDataDao;
    private final ProgramBeanDao programBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        offLineDataDaoConfig = daoConfigMap.get(OffLineDataDao.class).clone();
        offLineDataDaoConfig.initIdentityScope(type);

        programBeanDaoConfig = daoConfigMap.get(ProgramBeanDao.class).clone();
        programBeanDaoConfig.initIdentityScope(type);

        offLineDataDao = new OffLineDataDao(offLineDataDaoConfig, this);
        programBeanDao = new ProgramBeanDao(programBeanDaoConfig, this);

        registerDao(OffLineData.class, offLineDataDao);
        registerDao(ProgramBean.class, programBeanDao);
    }
    
    public void clear() {
        offLineDataDaoConfig.clearIdentityScope();
        programBeanDaoConfig.clearIdentityScope();
    }

    public OffLineDataDao getOffLineDataDao() {
        return offLineDataDao;
    }

    public ProgramBeanDao getProgramBeanDao() {
        return programBeanDao;
    }

}
